package com.example.dubbo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @author : Vick C
 * @version : v1.0
 * @date : 2020/6/17
 */
@Configuration
public class InitUploadConfig {

    @Bean
    public Object uploadMachineIp(RedisTemplate redisTemplate) throws UnknownHostException {
        InetAddress localHost = InetAddress.getLocalHost();
        String ip = localHost.getHostAddress();
        System.out.println("ip -- " + ip);
        //        redisTemplate.opsForSet().add("executor:ip", ip);
        return new Object();
    }
}
